import Sections from "@/components/Sections"
export default {
    components: {
        Sections
    },
    data() {
        return {
            loading: false, // 加载动画
            tableHeight: document.documentElement.clientHeight - 195, // 表的高度
            currentPage: 1,
            pageSize: 20,
            pageSizes: [20, 30, 60, 100],
            total: 0,
            search: {}, // 搜索内容
            tableData: []
        }
    },
    watch: {},
    mounted() {

    },

    methods: {
        // 更改每页展示数量
        handleSizeChange(val) {
            this.pageSize = val
            this.getList(this.search)
        },
        // 更改当前页数
        handleCurrentChange(val) {
            this.currentPage = val
            this.getList(this.search)
        },

        /** 搜索操作 */
        handleSearch(params) {
            this.currentPage = 1;
            this.search = params;
            this.getList(this.search);
        },

        /** 勾选操作 */
        // 当选择项发生变化时会触发该事件
        handleSelectionChange(val) {
            this.selectionList = val // 勾选的行
            this.$refs.TableHead.headSelectionChange(JSON.parse(JSON.stringify(val)))
        },

        /**关闭 */
        close() {
            this.isCreate = false;
            this.action = {
                type: "save",
                data: {},
            };
        },
    },

    beforeDestroy() { }
}
